# 导包
import requests
import config

# 创建接口类
class StaffAPI:
    # 添加员工
    def insert_staff(self, insert_data, token):
        return requests.post(url=f"{config.BASE_URL}/api/sys/user", json=insert_data, headers={"Authorization": token})
# 查询员工
    def select_staff(self,id,token):
        return requests.get(url=f"{config.BASE_URL}/api/sys/user/{id}",headers={"Authorization": token})
# 修改
    def update_staff(self,id,token,update_data):
        return requests.get(url=f"{config.BASE_URL}/api/sys/user/{id}",headers={"Authorization": token},json=update_data)
# 删除
    def del_staff(self,id,token):
        return requests.delete(url=f"{config.BASE_URL}/api/sys/user/{id}",headers={"Authorization": token})